package com.atguigu.mybatisplus.mapper;

import com.atguigu.mybatisplus.entity.NickUser;
import com.atguigu.mybatisplus.entity.User;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author study
 * @version 1.0
 * @date 2021/4/27 17:28
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    List<User> selectAllByName(@Param("name") String name);

    List<Map<String, Object>> selectSQL(String sql);

    int updateSQL(String sql);

    List<User> selectArray(@Param("split") String[] split);

    List<User> selectArrayOtherParam(@Param("age") Integer age, @Param("split") String[] split);

    List<User> selectArrayOtherParamOrderBy(@Param("age") Integer age, @Param("ordeBy") String orderby, @Param("split") String[] split);

    User condition(@Param("mzl") String mzl);

    User conditionInt(@Param("ints") int ints);

    User conditionIntCase(@Param("ints") int ints);

    Object conditionBan(@Param("name") String name);

    List<User> selectArrayTwo(@Param("ids") String ids);

    List<User> seleForListInt(@Param("lists") List<Integer> collect);

    IPage<NickUser> selectWrapper(IPage<NickUser> page, @Param(Constants.WRAPPER) Wrapper wrapper);
}
